GtkTreeIter iter;
gboolean found;
gboolean set;
- gboolean visible;
} SearchData;
-static gboolean
-path_visible (GtkTreeView *view,
- GtkTreePath *path)
-{
- GtkRBTree *tree;
- GtkRBNode *node;
-
- /* Note that we rely on the fact that collapsed rows don't have nodes
- */
- return _gtk_tree_view_find_node (view, path, &tree, &node);
-}
-
static gboolean
tree_next_func (GtkTreeModel *model,
GtkTreePath *path,
if (!tree_column_row_is_sensitive (search_data->combo, iter))
return FALSE;
- if (search_data->visible &&
- !path_visible (GTK_TREE_VIEW (search_data->combo->priv->tree_view), path))
- return FALSE;
-
search_data->set = TRUE;
search_data->iter = *iter;
tree_next (GtkComboBox *combo,
GtkTreeModel *model,
GtkTreeIter *iter,
- GtkTreeIter *next,
- gboolean visible)
+ GtkTreeIter *next)
{
SearchData search_data;
search_data.combo = combo;
search_data.path = gtk_tree_model_get_path (model, iter);
- search_data.visible = visible;
search_data.found = FALSE;
search_data.set = FALSE;
if (!tree_column_row_is_sensitive (search_data->combo, iter))
return FALSE;
- if (search_data->visible &&
- !path_visible (GTK_TREE_VIEW (search_data->combo->priv->tree_view), path))
- return FALSE;
-
search_data->set = TRUE;
search_data->iter = *iter;
tree_prev (GtkComboBox *combo,
GtkTreeModel *model,
GtkTreeIter *iter,
- GtkTreeIter *prev,
- gboolean visible)
+ GtkTreeIter *prev)
{
SearchData search_data;
search_data.combo = combo;
search_data.path = gtk_tree_model_get_path (model, iter);
- search_data.visible = visible;
search_data.found = FALSE;
search_data.set = FALSE;
if (!tree_column_row_is_sensitive (search_data->combo, iter))
return FALSE;
- /* Note that we rely on the fact that collapsed rows don't have nodes
- */
- if (search_data->visible &&
- !path_visible (GTK_TREE_VIEW (search_data->combo->priv->tree_view), path))
- return FALSE;
-
search_data->set = TRUE;
search_data->iter = *iter;
static gboolean
tree_last (GtkComboBox *combo,
GtkTreeModel *model,
- GtkTreeIter *last,
- gboolean visible)
+ GtkTreeIter *last)
{
SearchData search_data;
search_data.combo = combo;
- search_data.visible = visible;
search_data.set = FALSE;
gtk_tree_model_foreach (model, tree_last_func, &search_data);
if (!tree_column_row_is_sensitive (search_data->combo, iter))
return FALSE;
- if (search_data->visible &&
- !path_visible (GTK_TREE_VIEW (search_data->combo->priv->tree_view), path))
- return FALSE;
-
search_data->set = TRUE;
search_data->iter = *iter;
static gboolean
tree_first (GtkComboBox *combo,
GtkTreeModel *model,
- GtkTreeIter *first,
- gboolean visible)
+ GtkTreeIter *first)
{
SearchData search_data;
search_data.combo = combo;
- search_data.visible = visible;
search_data.set = FALSE;
gtk_tree_model_foreach (model, tree_first_func, &search_data);
if (event->direction == GDK_SCROLL_UP)
found = tree_prev (combo_box, combo_box->priv->model,
- &iter, &new_iter, FALSE);
+ &iter, &new_iter);
else
found = tree_next (combo_box, combo_box->priv->model,
- &iter, &new_iter, FALSE);
+ &iter, &new_iter);
if (found)
gtk_combo_box_set_active_iter (combo_box, &new_iter);
if (active_iter)
{
found = tree_prev (combo_box, combo_box->priv->model,
- &iter, &new_iter, FALSE);
+ &iter, &new_iter);
break;
}
/* else fall through */
case GTK_SCROLL_PAGE_DOWN:
case GTK_SCROLL_PAGE_RIGHT:
case GTK_SCROLL_END:
- found = tree_last (combo_box, combo_box->priv->model, &new_iter, FALSE);
+ found = tree_last (combo_box, combo_box->priv->model, &new_iter);
break;
case GTK_SCROLL_STEP_FORWARD:
if (active_iter)
{
found = tree_next (combo_box, combo_box->priv->model,
- &iter, &new_iter, FALSE);
+ &iter, &new_iter);
break;
}
/* else fall through */
case GTK_SCROLL_PAGE_UP:
case GTK_SCROLL_PAGE_LEFT:
case GTK_SCROLL_START:
- found = tree_first (combo_box, combo_box->priv->model, &new_iter, FALSE);
+ found = tree_first (combo_box, combo_box->priv->model, &new_iter);
break;
default: